package com.lg.startertemplate.controller;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "服务测试")
@RestController
@RequestMapping("/base")
public class BaseController {
    @Value("${server.port}")
    private String serverPort;

    @Autowired
    private DiscoveryClient client;


    @GetMapping("/hello")
    public String hello(){
        System.out.println("description === "+client.description());
        System.out.println("getOrder === "+client.getOrder());
        System.out.println("getServices === "+client.getServices());
        return "hello to see log";
    }


    @GetMapping("/baseConfig")
    public String getBaseConfig(){
        return serverPort;
    }
}
